class Single {
  static getInstance = (function () {
    let instance = null;
    return function () {
      if (!instance) {
        instance = new Single();
      }
      return instance;
    };
  })();
}

class Single {
  static instance = new Single();

  static getInstance = () => {
    return Single.instance;
  };
}

class Single {
  constructor() {
    if (Single.instance) {
      return Single.instance;
    }

    Single.instance = this;
  }
}

class Single {
  static instance = new Single();

  constructor() {
    if (Single.instance) {
      return Single.instance;
    }
  }
}
